package com.itheima.mapper;

import com.itheima.pojo.EmpPojo;
import org.apache.ibatis.annotations.*;



import java.util.List;

@Mapper
public interface EmpMapper {
    //查询根据id 返回值要用list接住
//    @Select("select * from emp where id=#{id}")
    List<EmpPojo> selectById(Integer id);

    @Delete("delete  from emp where id=#{id}")
    void deleteById(Integer id);

    //增加肯定是主键自增 所以不需要id
    @Insert("insert into emp(username, name, gender, image, job, entrydate, dept_id, create_time, update_time) " +
            "values (username=#{username},name=#{name}," +
            "gender=#{gender},job=#{job},entrydate=#{entrydate},dept_id=#{deptId}," +
            "create_time=#{createTime},updat_time=#{updateTime})")
    void insertEmp(EmpPojo empPojo );

    //动态sql 条件查询
    void select(String name,Integer id);

}
